<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改教研室信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-group-edit" th:object="${researchGroup}">
            <input name="groupId" th:field="*{groupId}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">教研室名称：</label>
                    <div class="col-sm-8">
                        <input name="groupName" th:field="*{groupName}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">教研室编码：</label>
                    <div class="col-sm-8">
                        <input name="groupCode" th:field="*{groupCode}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">关联专业：</label>
                    <div class="col-sm-8">
<!--                        <input name="majorId" th:field="*{majorId}" class="form-control" type="text">-->
                        <select name="majorId" class="form-control">
                            <option th:each="major:${majors}" th:value="${major.majorId}" th:text="${major.majorName}" th:selected="${major.majorId == researchGroup.majorId}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">教研室主任：</label>
                    <div class="col-sm-8">
<!--                        <input name="directorId" th:field="*{directorId}" class="form-control" type="text">-->
                        <select name="directorId" class="form-control">
                            <option th:each="director:${directors}" th:value="${director.userId}" th:text="${director.userName}" th:selected="${director.userId == researchGroup.directorId}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">教研室描述：</label>
                    <div class="col-sm-8">
                        <textarea name="description" class="form-control">[[*{description}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">办公地点：</label>
                    <div class="col-sm-8">
                        <input name="officeLocation" th:field="*{officeLocation}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">联系方式：</label>
                    <div class="col-sm-8">
                        <input name="contactPhone" th:field="*{contactPhone}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-8">
                        <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "college/group";
        $("#form-group-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-group-edit').serialize());
            }
        }
    </script>
</body>
</html>